﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using InventoryPro.DAL;
using InventoryPro.BL;

namespace InventryPro.Products
{
    public partial class CreateOrder : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSaveOrder_Click(object sender, EventArgs e) 
        {
            Order cust = new Order();
            cust.CustomerID = txtcustId.Text;
            cust.OrderDate = DateTime.Parse(TxtOrderDate.Text);
            cust.OrderID = int.Parse(TxtOrderId.Text);
            cust.RequiredDate = DateTime.Parse(TxtRequiredDate.Text);
            cust.ShipCountry = TxtShipCountry.Text;
            cust.ShipName = TxtShipName.Text;
            cust.ShippedDate = DateTime.Parse(TxtShipDate.Text);
            cust.ShipPostalCode = TxtShipPostalCode.Text;
            cust.ShipRegion = TxtShipRegion.Text;
            cust.ShipCountry = TxtShipCountry.Text;
            cust.CustomerID = txtcustId.Text;
            OrderLogic OrderBL = new OrderLogic();
            OrderBL.CreateOrder(cust);
            
        }
    }
}